from torchvision import models
from inspect import getmembers, isfunction

function_lists = [ o for o in getmembers(models)] if isfunction(o[1])
print("There are " + len(function_lists) + "models in total.")

for net in function_lists:
    print("jit scripting network:" + net[0])
    torch.jit.script(net[1]())


import torch
import timm

models = timm.list_models()

for model in timm.list_models():
    print("jit scripting network:" + model)
    torch.jit.script(timm.create_model(model))